package com.charger.service.impl;

import java.util.Collections;
import java.util.List;
import com.charger.common.utils.DateUtils;
import com.charger.domain.ChargerFinancialMiddle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.charger.mapper.ChargerFinancialMapper;
import com.charger.domain.ChargerFinancial;
import com.charger.service.IChargerFinancialService;

/**
 * 财务报表Service业务层处理
 * 
 * @author qkp
 * @date 2024-11-22
 */
@Service
public class ChargerFinancialServiceImpl implements IChargerFinancialService 
{
    @Autowired
    private ChargerFinancialMapper chargerFinancialMapper;

    /**
     * 查询财务报表
     * 
     * @param finanId 财务报表主键
     * @return 财务报表
     */
    @Override
    public ChargerFinancial selectChargerFinancialByFinanId(Long finanId)
    {
        return chargerFinancialMapper.selectChargerFinancialByFinanId(finanId);
    }

    /**
     * 查询财务报表列表
     * 
     * @param chargerFinancial 财务报表
     * @return 财务报表
     */
    @Override
    public List<ChargerFinancial> selectChargerFinancialList(ChargerFinancial chargerFinancial)
    {
        return chargerFinancialMapper.selectChargerFinancialList(chargerFinancial);
    }

    /**
     * 新增财务报表
     * 
     * @param chargerFinancial 财务报表
     * @return 结果
     */
    @Override
    public int insertChargerFinancial(ChargerFinancial chargerFinancial)
    {
        chargerFinancial.setCreateTime(DateUtils.getNowDate());
        return chargerFinancialMapper.insertChargerFinancial(chargerFinancial);
    }

    /**
     * 修改财务报表
     * 
     * @param chargerFinancial 财务报表
     * @return 结果
     */
    @Override
    public int updateChargerFinancial(ChargerFinancial chargerFinancial)
    {
        return chargerFinancialMapper.updateChargerFinancial(chargerFinancial);
    }

    /**
     * 批量删除财务报表
     * 
     * @param finanIds 需要删除的财务报表主键
     * @return 结果
     */
    @Override
    public int deleteChargerFinancialByFinanIds(Long[] finanIds)
    {
        return chargerFinancialMapper.deleteChargerFinancialByFinanIds(finanIds);
    }

    /**
     * 删除财务报表信息
     * 
     * @param finanId 财务报表主键
     * @return 结果
     */
    @Override
    public int deleteChargerFinancialByFinanId(Long finanId)
    {
        return chargerFinancialMapper.deleteChargerFinancialByFinanId(finanId);
    }

    /**
     *
     * @author QinKunPeng
     * @date 2024/11/24 19:33
     * @return java.util.List<com.charger.domain.ChargerFinancialMiddle>
     * 获取中间表信息
     */
    @Override
    public List<ChargerFinancialMiddle> listMiddleByDay(String day) {
        return chargerFinancialMapper.listMiddleByDay(day);
    }
}
